package Multithreading.Thread.ChaosBegins;

public class ChangeData implements Runnable{
    private long delda;
    private long loopCount;  //循环计数、
    private DataHolder dataHolder;

    public ChangeData(long delda, long loopCount, DataHolder dataHolder) {
        this.delda = delda;
        this.loopCount = loopCount;
        this.dataHolder = dataHolder;
    }

    @Override
    public void run() {
        for(int i = 0; i < loopCount; i++){
            dataHolder.change(delda);
        }
        dataHolder.print();
    }
}
